@extends('home.layout')
@section('content')

<!-- 电影标题 -->
<div class="movie_title_bg">
	<div class="movie_title">
		<p>
			<a>{{ $oneMovie -> name[0] }}</a>
			<a>({{$oneMovie -> time}})</a>
		</p>
		<a>{{ $oneMovie -> name[1] }}</a>
	</div>
</div>
<!-- 导航菜单 -->
<div class="movie_menu_bg">
	<div class="movie_menu">
		<a href="{{ url('/home/movie/details') }}/{{ $oneMovie -> id }}"><span>首</span> 页</a>
		<a href="{{ url('/home/movie/details') }}/{{ $oneMovie -> id }}/plots"><span>剧</span> 情</a>
		<a><span>视</span> 频</a>
		<a href="{{ url('/home/movie/details') }}/{{ $oneMovie -> id }}/image"><span>图</span> 片</a>
		<a href="{{ url('/home/movie/details') }}/{{ $oneMovie -> id }}/actor"><span>演</span> 员</a>
		<a style="background:#004C7F; color:#fff;" href="{{ url('/home/movie/details') }}/{{ $oneMovie -> id }}/comment"><span>影</span> 评</a>
		<a href="{{ url('/home/movie/details') }}/{{ $oneMovie -> id }}/other"><span>其</span> 他</a>
	</div>
</div>
	<!-- 剧情 -->
<div>
	<div class="movie_trailer">
		<div class="movie_trailer_list">
			<h3 style="display:inline-block;width:50px;height:35px;border-bottom:3px solid #000;">影评</h3>
			<!-- 评论 -->
			<form method="post" action="{{ url('/home/comment/comment') }}">
				{{ csrf_field() }}

				@if(session('user'))
				<input type="hidden" name="uid" value="{{ session('user') -> id }}">
				@endif

				<input type="hidden" name="auth" value="0">
				<input type="hidden" name="pid" value="{{ $oneMovie -> id }}">
					
				<div style="background:#fff;">
					<div style="background:#F5F5F5; color:#333;" class="writecomcon">
						<div class="usergrade">
							<a href="#">
								<div class="userdetails">
									<p>
										<img width="60" height="60" src="/home/images/default.png">
									</p>
									<span style="color:#333;">匿名</span>
								</div>
							</a>
							<div class="user-g">
								<i>我要评分:</i><br />
								1分<input class="clickLogin" type="radio" name="total" value="1" checked="checked" />
								2分<input class="clickLogin" type="radio" name="total" value="2" />
								3分<input class="clickLogin" type="radio" name="total" value="3" />
								4分<input class="clickLogin" type="radio" name="total" value="4" />
								5分 <input class="clickLogin" type="radio" name="total" value="5" /><br />
								6分<input class="clickLogin" type="radio" name="total" value="6" />
								7分<input class="clickLogin" type="radio" name="total" value="7" />
								8分<input class="clickLogin" type="radio" name="total" value="8" />
								9分<input class="clickLogin" type="radio" name="total" value="9" />
								10分<input class="clickLogin" type="radio" name="total" value="10" />
							</div>
						</div>
						<div class="cline"></div>
						<div class="userwrite">
							<textarea class="clickLogin" name="content" maxlength="600" placeholder="请输入对影评的简短评论,不超过200字"></textarea><br />
							<button>发表</button>
						</div>
					</div>
				</div>
			</form>
			<div class="show_comment">
				<h3 style="margin:0;display:inline-block;width:120px;height:50px;text-align:center;line-height:50px;background:#999;color:#fff;">最新影评</h3>
				<dl style="width:1000px;min-height:500px;">

					@foreach($comment as $key => $comments)
					<dd class="dan_com">
						<div class="user_com">
							<div style="width:48px;height:48px;">
								<a>
									<img width="48" height="48" src="{{ url($comments -> photo) }}">
								</a>
							</div>
							<div style="width:100px;height:48px;margin-left:5px;">
								<b>{{ $comments -> name }}</b><br>
								<b style="display:inline-block;width:30px;height:22px;background:#679C21;color:#fff;line-height:22px;text-align:center;">{{ $comments -> score }}</b>
							</div>
							<div style="margin-top:10px">
								{{ $comments -> ctime }}
							</div>
						</div>
						<div class="user_com_com">
							<p>
								{!! $comments -> content !!}
							</p>
							<div class="zan" style="float:right;">
								<a href="{{ url('/home/comment/couns') }}/{{ $comments -> id }}">	
									<em></em>{{ $comments ->  couns}}
								</a>
								<a href="{{ url('/home/movie/details') }}/{{ $comments -> pid }}/comment">	
									<em></em>{{ $comments ->  count}}
								</a>
							</div>

							<form action="{{ url('/home/comment/reply') }}" method="post">

								{{ csrf_field() }}

								@if(session('user'))
								<input type="hidden" name="uid" value="{{ session('user') -> id }}">
								@endif

								<input type="hidden" name="pid" value="{{ $comments -> id }}">
								<input type="hidden" name="mid" value="{{ $comments -> pid }}">

								<textarea class="clickLogin" name="content" maxlength="600" placeholder="发表评论,不超过200字"></textarea>
								<button>回复</button>
							</form>


							<div style="width:500px;">
								
								@foreach($reply[$key] as $replys)
								<div style="border-bottom:1px solid #ccc;padding-top:5px;">
									<a>
										<img width="32" height="32" src="{{ $replys -> photo }}">
										{{ $replys -> name }}
									</a>
									&nbsp;&nbsp;&nbsp;&nbsp;
									<span>{{ $replys -> ctime }}</span>
									<p>{{ $replys -> content }}</p>
								</div>
								@endforeach

							</div>
						</div>
					</dd>
					@endforeach
					
				</dl>
				<div style="margin:0 auto;" class="paging">
					{!! $comment->render() !!}
				</div>
			</div>
		</div>
	</div>
</div>
<div class="pagination"></div>

@endsection